PATH  Mac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Icon Services and Utilities
>
Obtaining and Using Icons With Icon Services

   

RegisterIconRefFromResource

Adds a resource-derived IconRef to the Icon Services registry.

pascal OSErr RegisterIconRefFromResource (
                     OSType creator,
                     OSType iconType,
                     FSSpec*resourceFile,
                     SInt16 resourceID,
                     IconRef*iconRef);

creator
A value of type OSType specifying the creator code of the icon data you wish to register. You can use your application's creator code, for example.

Note

Lower-case creator codes are reserved for the system.

iconType
A value of type OSType specifying the type code of the icon data you wish to register.

resourceFile
A pointer to a structure of type FSSpec specifying the resource file from which to read the icon data. For more information on the FSSpec structure, see Inside Macintosh: Files.

resourceID
A value of type SInt16 specifying the resource ID of the icon data to be registered. This value must be non-zero. You should provide a resource of type 'icns' if possible. If an 'icns' resource is not available, Icon Services uses standard icon suite resources, such as 'ICN#' , instead.

iconRef
A pointer to a value of type IconRef . On return, this value contains a reference to the specified icon data.

function result
A result code. See Icon Services Result Codes for a description of possible return values.
DISCUSSION
You can use the RegisterIconRefFromResource function to register icons from 'icns' resources or "classic" custom icon resources ('ics#' , 'ICN#' , etc.). Icon Services searches 'icns' resources before searching other icon resources.

Calling this function increments the reference count of the IconRef .

Note

Remember to call the function ReleaseIconRef when you're done with an IconRef .


© 1999 Apple Computer, Inc. – (Last Updated 03 Dec 99)